
float threshold;
float intensity;
float age;
float4x4 View;
float4x4 Projection;
texture Texture;
sampler Sampler = sampler_state
{
    Texture = (Texture);
    
    MinFilter = Linear;
    MagFilter = Linear;
    MipFilter = Linear;
    
    AddressU = Clamp;
    AddressV = Clamp;
};

struct VertexShaderInput
{
    float4 Position : POSITION0;
};

struct VertexShaderOutput
{
    float4 Position : POSITION0;
    float2 Texcoord : TEXCOORD0;
};

VertexShaderOutput VS(VertexShaderInput input)
{
    VertexShaderOutput output;
    output.Position = input.Position.xzyw;
    output.Position.xy = (output.Position.xy*2.0 - 1.0);
    output.Position.w = 1.0;
    output.Texcoord = input.Position.xz;
    output.Texcoord.y = 1.0 - output.Texcoord.y;
    return output;
}

float4 PSa(VertexShaderOutput input) : COLOR0
{
/*
	float4 c = tex2D(Sampler,input.Texcoord);
    float lum = 0.3*c.r + 0.59*c.g + 0.11*c.b;
	float t;
	if(lum > threshold)
	{
		t = (lum - threshold)/(1.0 - threshold);
	}
	else
	{
		t = -(lum - threshold)/(0 - threshold);
	}
	float age_t = 2.0*abs(age-0.5);
	age_t *= age_t;
	c += c*intensity*t*lerp(0.5,0.0,age_t);
	c.a = 1.0f;
	return c;
	*/
	return 1;
}

technique Technique1
{
    pass Pass1
    {
        VertexShader = compile vs_2_0 VS();
        PixelShader = compile ps_2_0 PSa();
    }
}
